home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  2.0 KB  |  96 lines

  1. #ifndef MC_MOUSE_H
  2. #define MC_MOUSE_H
  3.  
  4. #ifdef HAVE_LIBGPM
  5.  
  6. /* GPM mouse support include file */
  7. #ifdef HAVE_LIBGPM
  8. #include <gpm.h>
  9. #else
  10. #include "gpm-xterm.h"
  11. #endif
  12.  
  13. #else
  14.  
  15. /* Equivalent definitions for non-GPM mouse support */
  16. /* These lines are modified version from the lines appearing in the */
  17. /* gpm.h include file of the Linux General Purpose Mouse server */
  18.  
  19. #define GPM_B_LEFT      4
  20. #define GPM_B_MIDDLE    2
  21. #define GPM_B_RIGHT     1
  22.  
  23. /* Xterm mouse support supports only GPM_DOWN and GPM_UP */
  24. /* If you use others make sure your code also works without them */
  25. enum Gpm_Etype {
  26.   GPM_MOVE=1,
  27.   GPM_DRAG=2,   /* exactly one in four is active at a time */
  28.   GPM_DOWN=4,
  29.   GPM_UP=  8,
  30.  
  31. #define GPM_BARE_EVENTS(ev) ((ev)&0xF)
  32.  
  33.   GPM_SINGLE=16,            /* at most one in three is set */
  34.   GPM_DOUBLE=32,
  35.   GPM_TRIPLE=64,
  36.       
  37.   GPM_MFLAG=128,            /* motion during click? */
  38.   GPM_HARD=256             /* if set in the defaultMask, force an already
  39.                               used event to pass over to another handler */
  40. };
  41.  
  42. typedef struct Gpm_Event {
  43.   int buttons, x, y;
  44.   enum Gpm_Etype type;
  45. } Gpm_Event;
  46.  
  47. extern int gpm_fd;
  48.  
  49. #endif
  50.  
  51. /* General mouse support definitions */
  52.  
  53. typedef int (*mouse_h)(Gpm_Event *, void *);
  54.  
  55. #define NO_MOUSE 0
  56. #define GPM_MOUSE 1
  57. #define XTERM_MOUSE 2
  58.  
  59. void init_mouse (void);
  60. void shut_mouse (void);
  61.  
  62. /* Type of mouse: NO_MOUSE, GPM_MOUSE or XTERM_MOUSE */
  63. extern int use_mouse_p;
  64. /* If use_mouse_p is XTERM_MOUSE: is mouse currently active? */
  65. extern int xmouse_flag;
  66.  
  67. int mouse_handler (Gpm_Event *gpm_event);
  68. int redo_mouse (Gpm_Event *event);
  69.  
  70. /* Constants returned from mouse handlers */
  71.  
  72. #define MOU_NORMAL    0x00
  73. #define MOU_REPEAT    0x01
  74. #define MOU_ENDLOOP   0x02
  75. #define MOU_LOCK      0x04
  76.  
  77. #ifdef DEBUGMOUSE
  78. #define DEBUGM(data) fprintf data
  79. #else
  80. #define DEBUGM(data) 
  81. #endif
  82.  
  83. #ifdef HAVE_LIBGPM
  84.  
  85. /* GPM specific mouse support definitions */
  86. void show_mouse_pointer (int x, int y);
  87.  
  88. #else
  89.  
  90. /* Mouse support definitions for non-GPM mouse */
  91. #define show_mouse_pointer(a,b)
  92.  
  93. #endif
  94.  
  95. #endif /* MC_MOUSE_H */
  96.